package com.corpgovernment.permission.mapper;

import com.corpgovernment.organization.common.mybatis.TkMapper;

import com.corpgovernment.permission.entity.db.Menu;
import com.corpgovernment.permission.entity.db.MenuTemp;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author zl.cui
 * @date 2024/3/8
 */
@Mapper
public interface MenuTempMapper extends TkMapper<MenuTemp> {

    @Select("select * from menu_temp order by datachange_lasttime  limit 1")
    MenuTemp getLastRecord();
    @Select("select * from menu_temp order by datachange_lasttime desc limit 1")
    MenuTemp getTheOldestRecord();
    @Update("update menu_temp set menu_json = #{menuJson}, datachange_lasttime = CURRENT_TIMESTAMP where id=#{id}")
    int updateById(@Param("id") Long id,@Param("menuJson") String menuJson);
}
